%% This function estimate the Variance-Covariance matrix of the vector theta of mean constraints 
%% Inputs
% B= # bootsrap replications
function V=vct(Y,Z,D,B)

%Sample size
n=length(Y);



mu=zeros(4,B);
% x draw an (n,B1) matrix of integers from the interval [1,2,...,n]
x=ceil(n*rand(n,B));
% Create bootstrap samples
yboot = Y(x);
dboot = D(x);
zboot = Z(x);

for i=1:B
    mu(:,i)=incons(yboot(:,i),zboot(:,i),dboot(:,i),0);
end

Vb=cov(mu');

V=n*Vb;
 